﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Cadastros_Turno" Codebehind="Turno.aspx.cs" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<%@ Register src="../Usercontrol/wuscSeguranca.ascx" tagname="wuscSeguranca" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head id="Head1" runat="server"> 
    <title></title> 
    <script type="text/javascript">
        function RowDblClick(sender, eventArgs) {
            sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());

        } 
    </script> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <asp:ObjectDataSource ID="ods_Turno" runat="server"  
        DeleteMethod="_excluir_Turno" InsertMethod="_inserir_Turno"  
        SelectMethod="_obter_Turno" TypeName="Banco.BD_Turno"  
        UpdateMethod="_atualizar_Turno"> 
        <DeleteParameters>
            <asp:Parameter Name="TURNO_ID" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="TURNO_ID" Type="String" />
            <asp:Parameter Name="TUR_DESCRICAO" Type="String" />
            <asp:Parameter Name="TUR_EXLUIDO" Type="Boolean" />
        </InsertParameters>
        <SelectParameters> 
            <asp:Parameter Name="TURNO_ID" Type="String" /> 
            <asp:Parameter Name="TUR_DESCRICAO" Type="String" /> 
            <asp:Parameter Name="TUR_EXLUIDO" Type="String" />
            <asp:Parameter Name="ORDER_BY_CLAUSE" Type="String" />
        </SelectParameters> 
        <UpdateParameters>
            <asp:Parameter Name="TURNO_ID" Type="String" />
            <asp:Parameter Name="TUR_DESCRICAO" Type="String" />
            <asp:Parameter Name="TUR_EXLUIDO" Type="Boolean" />
        </UpdateParameters>
    </asp:ObjectDataSource> 
    
    <uc1:wuscSeguranca ID="wuscSeguranca1" runat="server" /> 

    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
        </telerik:RadScriptManager> 
 
        <telerik:RadAjaxLoadingPanel ID="ralpGrid" runat="server" Skin="Default"> 
          </telerik:RadAjaxLoadingPanel> 
 
                 <telerik:RadAjaxPanel ID="rapGrid" runat="server" Height="480px" 
                    Width="100%" HorizontalAlign="NotSet" LoadingPanelID="ralpGrid" 
                    onajaxrequest="rapGrid_AjaxRequest"> 
                
                     <telerik:RadGrid ID="rdg_Turno" runat="server" DataSourceID="ods_Turno" 
                         GridLines="None" Skin="Sunset" AllowFilteringByColumn="True">
                         <ClientSettings>
                             <Selecting AllowRowSelect="True" />
                             <ClientEvents OnRowDblClick="RowDblClick" />
                         </ClientSettings>
                         <MasterTableView AutoGenerateColumns="False" DataSourceID="ods_Turno" EditMode="PopUp"
                             AllowAutomaticDeletes="True" AllowAutomaticInserts="True" 
                             AllowAutomaticUpdates="True" ClientDataKeyNames="TURNO_ID" 
                             DataKeyNames="TURNO_ID" CommandItemDisplay="Top"  PageSize="15" Height="480px">
                             <CommandItemSettings AddNewRecordText="Adiconar Novo registro" 
                                 ExportToExcelText="Exportar para Excel" ExportToPdfText="Exportar para PDF" 
                                 RefreshText="Atualizar" ShowExportToExcelButton="True" 
                                 ShowExportToPdfButton="True" />
                             <Columns>
                                 <telerik:GridBoundColumn DataField="TURNO_ID" HeaderText="Código" ReadOnly="true"
                                     SortExpression="TURNO_ID" UniqueName="TURNO_ID">
                                     <HeaderStyle Width="120px" /> 
                                     <ItemStyle Font-Size="X-Small" Width="120px" /> 
                                 </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn DataField="TUR_DESCRICAO" HeaderText="Horário" 
                                     SortExpression="TUR_DESCRICAO" UniqueName="TUR_DESCRICAO">
                                     <HeaderStyle  /> 
                                     <ItemStyle Font-Size="X-Small" /> 
                                 </telerik:GridBoundColumn>
                                  <telerik:GridCheckBoxColumn DataField="TUR_EXLUIDO" HeaderText="Inativo" UniqueName="TUR_EXLUIDO" 
                                        AllowFiltering="false">
                                    <HeaderStyle HorizontalAlign="Center" Width="75px" /> 
                                    <ItemStyle HorizontalAlign="Center" Width="75px" /> 
                                </telerik:GridCheckBoxColumn>
                                                                  
                                <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText=""  
                                    CancelText="" InsertText="" UpdateText="" EditImageUrl="../Imagens/grid_edit.png">             
                                    <HeaderStyle HorizontalAlign="Center" Width="40px" /> 
                                    <ItemStyle HorizontalAlign="Center" Width="40px" /> 
                                </telerik:GridEditCommandColumn> 
                                <telerik:GridButtonColumn ButtonType="ImageButton"  
                                    CommandName="Delete" ConfirmDialogType="RadWindow"  
                                    ConfirmText="Deseja realmente excluir este registro"  
                                    ImageUrl="../Imagens/grid_delete.png" UniqueName="DeleteColumn"  
                                    ConfirmTitle="Exclusão de registro" Text="Delete"> 
             
                                    <HeaderStyle HorizontalAlign="Center" Width="40px" /> 
                                    <ItemStyle HorizontalAlign="Center" Width="40px" /> 
                                </telerik:GridButtonColumn> 

                             </Columns>
                             <EditFormSettings> 
                                <EditColumn UniqueName="EditCommandColumn1" ButtonType="ImageButton"></EditColumn> 
                                    <PopUpSettings Modal="True" /> 
                             </EditFormSettings> 
                         </MasterTableView>
                     </telerik:RadGrid>
         
                </telerik:RadAjaxPanel>
         
     
    </div> 
    </form> 
</body> 
</html> 

